
/**
 * ARexxXml.h
 * @date {DATE}
 * @author
 */

#ifndef AREXXML_H
#define AREXXML_H

#define ALL_REACTION_CLASSES
#include <reaction/reaction.h>
#include <reaction/reaction_macros.h>

#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "XmlHandler.h"
#include "ARexxXmlException.h"


#define VERSTAG "\0$VER: ARexxXml 1.2 (2.3.2015) Joakim Nordstrom"
STRPTR USED ver = (STRPTR)VERSTAG;

#define TEMPLATE          "NEWPORT/S"
#define OPT_MULTIPLEINSTANCES    0
#define OPT_COUNT   1

#ifdef DEBUG
#define AREXXXML_H_DEBUG printf
#else
#define AREXXXML_H_DEBUG(x, y...) {}
#endif

/* Protos for the reply hook and ARexx command functions. */
extern void reply_callback(struct Hook *, Object *, struct RexxMsg *);
extern void rexx_LoadXml (struct ARexxCmd *, struct RexxMsg *);
extern void rexx_GetTag (struct ARexxCmd *, struct RexxMsg *);
extern void rexx_Quit (struct ARexxCmd *, struct RexxMsg *);
extern void rexx_Dispose (struct ARexxCmd *, struct RexxMsg *);

class ARexxXml {
  public:

    /* ARexx command IDs. */
    enum
    {
        REXX_LOADXML,
        REXX_TAG,
        REXX_DISPOSE,
        REXX_QUIT,
        REXX_DATE
    };

    ARexxXml();
    ~ARexxXml();
    void StartMainLoop();
    static BOOL running;
    static XmlHandler * xmlHandler;
    void SetNoSlot(BOOL noSlot) { _noSlot = noSlot; };
  protected:
    Object *arexx_obj;
    BOOL _noSlot;
  private:

};

#endif

